using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace OrderService.Application.Dtos
{
    /// <summary>
    /// 创建订单请求
    /// </summary>
    public class CreateOrderRequest
    {
        /// <summary>
        /// 客户ID
        /// </summary>
        [Required]
        public Guid CustomerId { get; set; }

        /// <summary>
        /// 订单项
        /// </summary>
        [Required]
        [MinLength(1)]
        public List<OrderItemRequest> Items { get; set; }

        /// <summary>
        /// 配送地址
        /// </summary>
        [Required]
        [MaxLength(200)]
        public string ShippingAddress { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [Required]
        [Phone]
        public string PhoneNumber { get; set; }
    }

    /// <summary>
    /// 订单项请求
    /// </summary>
    public class OrderItemRequest
    {
        /// <summary>
        /// 产品ID
        /// </summary>
        [Required]
        public Guid ProductId { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string ProductName { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [Required]
        [Range(1, int.MaxValue)]
        public int Quantity { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        [Required]
        [Range(0.01, double.MaxValue)]
        public decimal UnitPrice { get; set; }
    }
}